<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>YoiaL</title><meta name="author" content="John Doe"><meta name="copyright" content="John Doe"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta property="og:type" content="website">
<meta property="og:title" content="YoiaL">
<meta property="og:url" content="https://liaoyia.gitee.io/page/2/index.html">
<meta property="og:site_name" content="YoiaL">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://liaoyia.gitee.io/null">
<meta property="article:author" content="John Doe">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://liaoyia.gitee.io/null"><link rel="shortcut icon" href="/liaoyia/img/favicon.png"><link rel="canonical" href="https://liaoyia.gitee.io/page/2/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/liaoyia/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/liaoyia/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: {"defaultEncoding":1,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: true,
    post: true
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#121212","position":"bottom-center"},
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: true,
  islazyload: false,
  isanchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = { 
  isPost: false,
  isHome: true,
  isHighlightShrink: false,
  isToc: false,
  postUpdate: '2021-03-21 14:57:02'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    })(window)</script><link rel="stylesheet" href="/css/fishes.css"><style type="text/css">#toggle-sidebar { left : 100px }</style><meta name="generator" content="Hexo 5.4.0"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" src="/liaoyia/null" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/liaoyia/archives/"><div class="headline">文章</div><div class="length-num">16</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/liaoyia/tags/"><div class="headline">标签</div><div class="length-num">9</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/liaoyia/categories/"><div class="headline">分类</div><div class="length-num">6</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/liaoyia/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fa-fw fas fa-compass"></i><span> 目录</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/liaoyia/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></li><li><a class="site-page" href="/liaoyia/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li><li><a class="site-page" href="/liaoyia/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fa-fw fa fa-heartbeat"></i><span> 娱乐</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/liaoyia/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page" href="/liaoyia/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li><li><a class="site-page" href="/liaoyia/books/"><i class="fa-fw fa fa-book"></i><span> 书籍</span></a></li><li><a class="site-page" href="/liaoyia/games/"><i class="fa-fw fa fa-gamepad"></i><span> 游戏</span></a></li><li><a class="site-page" href="/liaoyia/ziyu/"><i class="fa-fw fa-fw fas fa-cubes"></i><span> 自言自语</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw laptop-code"></i><span> 🎯</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/liaoyia/messages/"><i class="fa-fw fa-fw fas fa-comment-dots"></i><span> 留言板</span></a></li><li><a class="site-page" href="/liaoyia/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></li><li><a class="site-page" href="/liaoyia/about/"><i class="fa-fw fa-fw fas fa-heart"></i><span> 关于我</span></a></li></ul></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-image: url('https://cdn.jsdelivr.net/gh/liaoyio/imgHosting/aaaaaaaa.png')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/liaoyia/">YoiaL</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/liaoyia/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fa-fw fas fa-compass"></i><span> 目录</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/liaoyia/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></li><li><a class="site-page" href="/liaoyia/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li><li><a class="site-page" href="/liaoyia/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fa-fw fa fa-heartbeat"></i><span> 娱乐</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/liaoyia/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page" href="/liaoyia/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li><li><a class="site-page" href="/liaoyia/books/"><i class="fa-fw fa fa-book"></i><span> 书籍</span></a></li><li><a class="site-page" href="/liaoyia/games/"><i class="fa-fw fa fa-gamepad"></i><span> 游戏</span></a></li><li><a class="site-page" href="/liaoyia/ziyu/"><i class="fa-fw fa-fw fas fa-cubes"></i><span> 自言自语</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw laptop-code"></i><span> 🎯</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/liaoyia/messages/"><i class="fa-fw fa-fw fas fa-comment-dots"></i><span> 留言板</span></a></li><li><a class="site-page" href="/liaoyia/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></li><li><a class="site-page" href="/liaoyia/about/"><i class="fa-fw fa-fw fas fa-heart"></i><span> 关于我</span></a></li></ul></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">YoiaL</h1><div id="site-subtitle"><span id="subtitle"></span></div><div id="site_social_icons"><a class="social-icon" href="https://github.com/liaoyio" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="/liaoyia/2417276459" target="_blank" title="QQ"><i class="fas fa-qq"></i></a></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left_radius"><a href="/liaoyia/2019/12/11/shell/" title="Shell初探">     <img class="post_bg" src="https://cdn.jsdelivr.net/gh/liaoyio/imgHosting/img-lybash.png" onerror="this.onerror=null;this.src='/liaoyia/img/404.jpg'" alt="Shell初探"></a></div><div class="recent-post-info"><a class="article-title" href="/liaoyia/2019/12/11/shell/" title="Shell初探">Shell初探</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2019-12-11T05:08:11.000Z" title="发表于 2019-12-11 13:08:11">2019-12-11</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-03-01T09:05:27.082Z" title="更新于 2021-03-01 17:05:27">2021-03-01</time></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/liaoyia/tags/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/liaoyia/tags/%E8%8F%9C%E9%B8%9F%E5%85%A5%E9%97%A8/">菜鸟入门</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/liaoyia/tags/Linux/">Linux</a></span></div><div class="content">Shell概念
Shell是一个命令行解释器,它为用户提供了一个向 Linux内核发送请求以便运行程序的界面系统级程序,用户可以用Shll来启动、挂起、停止甚至是编写一些程序。
一、Shell基础
1. 第一个脚本
1. 输出命令：
echo [选项]  [输出内容]  选项   -e  加上-e表示支持反斜线控制的字符转换
2. 第一个脚本
vi hello.sh  \ #!&#x2F;bin&#x2F;Bash  表示写的脚本是shell脚本  主要是声明作用在这里————#不是注释\ #2019&#x2F;12&#x2F;11 liaoyi   这里的#表示注释功能  echo  -e 	“这里写需要打印的内容”  保存退出
3. 执行脚本
1. 赋予执行权限(1) $ chmod 755 hello.sh(2) $ chmod u+x hello.sh    #赋予脚本hello.sh脚本执行权限。然后通过路径&#x2F;hello.sh来执行2. $bash hello.sh 来执行.3. $sh hello.sh
注意：运行在Windows下编写的脚本会提示文件格式错误，此 ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/liaoyia/2019/11/26/2020/" title="“ 如果生活是夹心汤圆，那我这碗是一团糟糕。 ”">     <img class="post_bg" src="https://cdn.jsdelivr.net/gh/liaoyio/imgHosting/img-ly20200101.jpg" onerror="this.onerror=null;this.src='/liaoyia/img/404.jpg'" alt="“ 如果生活是夹心汤圆，那我这碗是一团糟糕。 ”"></a></div><div class="recent-post-info"><a class="article-title" href="/liaoyia/2019/11/26/2020/" title="“ 如果生活是夹心汤圆，那我这碗是一团糟糕。 ”">“ 如果生活是夹心汤圆，那我这碗是一团糟糕。 ”</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2019-11-26T08:30:00.000Z" title="发表于 2019-11-26 16:30:00">2019-11-26</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2020-03-14T06:38:31.757Z" title="更新于 2020-03-14 14:38:31">2020-03-14</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/liaoyia/categories/%E6%96%87%E5%AD%97%E5%8F%99%E8%BF%B0%E4%BD%93/">文字叙述体</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/liaoyia/categories/%E6%96%87%E5%AD%97%E5%8F%99%E8%BF%B0%E4%BD%93/%E7%94%9F%E8%80%8C%E4%B8%BA%E4%BA%BA-%E6%8A%B1%E6%AD%89/">生而为人 抱歉</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/liaoyia/tags/My-blog/">My blog</a></span></div><div class="content">我并没有迫切的想要开始2020年。
就像站在2017去期待2018的到来会带走所有厄运和阴霾那样
新的年份只意味着时间点上新的轮回
至于这日子是好是坏  是甜是涩  要靠自己去把握。
还是那句话：真正带来好运的不是新年，而是你想要重新开始的决心。 ​
</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/liaoyia/2019/11/15/linux-%E6%96%87%E4%BB%B6%E6%9D%83%E9%99%90/" title="Linux 文件权限">     <img class="post_bg" src="https://cdn.jsdelivr.net/gh/liaoyio/imgHosting/img-lyphotos677.jpg" onerror="this.onerror=null;this.src='/liaoyia/img/404.jpg'" alt="Linux 文件权限"></a></div><div class="recent-post-info"><a class="article-title" href="/liaoyia/2019/11/15/linux-%E6%96%87%E4%BB%B6%E6%9D%83%E9%99%90/" title="Linux 文件权限">Linux 文件权限</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2019-11-15T09:32:00.000Z" title="发表于 2019-11-15 17:32:00">2019-11-15</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2020-03-14T11:47:14.059Z" title="更新于 2020-03-14 19:47:14">2020-03-14</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/liaoyia/categories/linux/">linux</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/liaoyia/tags/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/liaoyia/tags/%E8%8F%9C%E9%B8%9F%E5%85%A5%E9%97%A8/">菜鸟入门</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/liaoyia/tags/Linux/">Linux</a></span></div><div class="content">课程思维导图
不擅长排版码子，所以了思维导图。
![](https://cdn.jsdelivr.net/gh/liaoyio/imgHosting/img-lyphotos5.2 Linux文件权限.png)
Linux /etc/passwd文件的构成
文件的内容：

每个Linux都会有root账号，以此来说明，从内容上看，每行都使用【:】分隔（注意：每行前面的数字是行号，不是内容），所以一共有七部分内容，分别是：


账号名称：root，用来对应UID



口令：x



(早期Unix系统的口令放在这个字段。但因为这个文件对所有用户都是可读取的（ls -l /etc/passwd 即可看出来），这样容易造成口令被窃的风险，因此之后这个口令放到/etc/shadow文件中了。该位置就保留了一个【x】，没啥含义.)

使用者标识符：UID


Linux对UID的限制如下所示——

所以，UID为0的时候，就是root

用户组：GID


这个与/etc/group有关。

用户信息说明栏：root


用来解释账号的意义。

家目录：/root


root的家目录就是 / ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/liaoyia/2019/11/12/Linux-%E7%BD%91%E7%BB%9C%E9%85%8D%E7%BD%AE/" title="Iinux 网络配置">     <img class="post_bg" src="https://cdn.jsdelivr.net/gh/liaoyio/imgHosting/img-lylinux.jpg" onerror="this.onerror=null;this.src='/liaoyia/img/404.jpg'" alt="Iinux 网络配置"></a></div><div class="recent-post-info"><a class="article-title" href="/liaoyia/2019/11/12/Linux-%E7%BD%91%E7%BB%9C%E9%85%8D%E7%BD%AE/" title="Iinux 网络配置">Iinux 网络配置</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2019-11-12T14:58:58.000Z" title="发表于 2019-11-12 22:58:58">2019-11-12</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2020-03-14T06:32:43.595Z" title="更新于 2020-03-14 14:32:43">2020-03-14</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/liaoyia/categories/Linux/">Linux</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/liaoyia/tags/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/liaoyia/tags/%E8%8F%9C%E9%B8%9F%E5%85%A5%E9%97%A8/">菜鸟入门</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/liaoyia/tags/Linux/">Linux</a></span></div><div class="content">一、前言


1、准备工作，安装好VMware WorkSstation,Centos7镜像文件。这里我就不多介绍了。


2、虚拟机网络模式分类：Bridged（桥接模式）、NAT（网络地址转换模式）、Host-Only（仅主机模式）


![](https://cdn.jsdelivr.net/gh/liaoyio/imgHosting/img-lyphotoslinux 1.png)
二、centos7网络配置过程（NAT模式）

1、查看虚拟网络编辑器相关信息
在VMware WorkingStation 中点击==》 编辑==》 虚拟网络编辑器==》  NAT设置如下图可以查看当前的子网IP/子网掩码/网关IP，如下图所示（每个人的不一样，需要记起来这些地址，待会修改网卡配置文件时会用到）



2、在此界面下同时选定为NAT模式。

- 3.修改虚拟网卡配置文件.
（1）通过命令进入配置文件(注意我这里是Centos7的，所以进入的是ifcfg-ens33,如果是Centos6,则进入ifcfg-eth0.建议命令输入到ifcfg-,然后按tab键两下，就可以看到有什么文件 ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/liaoyia/2019/11/12/Github+jsDelivr+PicGo/" title="Github+jsDelivr+PicGo 打造稳定快速、高效免费图床">     <img class="post_bg" src="https://cdn.jsdelivr.net/gh/liaoyio/imgHosting/img-lypigo.png" onerror="this.onerror=null;this.src='/liaoyia/img/404.jpg'" alt="Github+jsDelivr+PicGo 打造稳定快速、高效免费图床"></a></div><div class="recent-post-info"><a class="article-title" href="/liaoyia/2019/11/12/Github+jsDelivr+PicGo/" title="Github+jsDelivr+PicGo 打造稳定快速、高效免费图床">Github+jsDelivr+PicGo 打造稳定快速、高效免费图床</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2019-11-12T05:23:35.000Z" title="发表于 2019-11-12 13:23:35">2019-11-12</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2020-03-14T11:38:18.473Z" title="更新于 2020-03-14 19:38:18">2020-03-14</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/liaoyia/categories/hexo-blog/">hexo-blog</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/liaoyia/tags/%E5%85%B3%E4%BA%8E%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/">关于博客搭建</a></span></div><div class="content">什么是图床 ？
图床，也就是专门提供存储图片的地方，我们只要通过图床提供的 API 接口，把图片上传上去，就可以通过外链访问了，根本不用操心图片是怎么存的，硬盘空间不够了，硬盘坏了，访问速度比较慢等等问题，这些图床都会帮我们搞定，他们会用各种技术帮我们做图片相关的优化和服务，比如多机互备、CDN 加速、图片处理、图片鉴黄、文本识别等等。对于我们个人用户来说，要求也没那么高，图床已经完全能满足我们的需求了.
前言
先来对比一下各路图床：


微博图床：以前用的人比较多，从2019年4月开始开启了防盗链，凉凉.


SM.MS：运营四年多了，也变得越来越慢了，到了晚上直接打不开图片，速度堪忧.


其他小众图床： 随时有挂掉的风险.


Imgur等国外图床： 国内访问速度太慢，随时有被墙的风险


大厂储存服务：例如七牛云、又拍云、腾讯云COS、阿里云OSS等，操作繁琐，又是实名认证又是域名备案的，麻烦，而且还要花钱（有钱又不怕麻烦的当我没说）。


因此，GitHub图床是个不错的选择，利用jsDelivr CDN加速访问（jsDelivr 是一个免费开源的 CDN 解决方案），Pic ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/liaoyia/2018/11/30/%E7%AC%AC%E4%B8%80%E7%AF%87%E5%8D%9A%E5%AE%A2/" title="第一篇博客">     <img class="post_bg" src="https://cdn.jsdelivr.net/gh/liaoyio/imgHosting/img-ly003.jpg" onerror="this.onerror=null;this.src='/liaoyia/img/404.jpg'" alt="第一篇博客"></a></div><div class="recent-post-info"><a class="article-title" href="/liaoyia/2018/11/30/%E7%AC%AC%E4%B8%80%E7%AF%87%E5%8D%9A%E5%AE%A2/" title="第一篇博客">第一篇博客</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2018-11-30T09:30:00.000Z" title="发表于 2018-11-30 17:30:00">2018-11-30</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2020-03-14T06:27:45.738Z" title="更新于 2020-03-14 14:27:45">2020-03-14</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/liaoyia/categories/%E6%96%87%E5%AD%97%E5%8F%99%E8%BF%B0%E4%BD%93/">文字叙述体</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/liaoyia/tags/My-blog/">My blog</a></span></div><div class="content">第一次见面
好不容易，费尽周折，终于建站！！
关于Markdown
当你能够正常访问这个页面时，相信你已经知道以后写博客文章是基于Markdown语法的，请熟练使用他。
祝我好运
</div></div></div><nav id="pagination"><div class="pagination"><a class="extend prev" rel="prev" href="/liaoyia/"><i class="fas fa-chevron-left fa-fw"></i></a><a class="page-number" href="/liaoyia/">1</a><span class="page-number current">2</span></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="card-info-avatar is-center"><img class="avatar-img" src="/liaoyia/null" onerror="this.onerror=null;this.src='/liaoyia/img/friend_404.gif'" alt="avatar"/><div class="author-info__name">John Doe</div><div class="author-info__description"></div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/liaoyia/archives/"><div class="headline">文章</div><div class="length-num">16</div></a></div><div class="card-info-data-item is-center"><a href="/liaoyia/tags/"><div class="headline">标签</div><div class="length-num">9</div></a></div><div class="card-info-data-item is-center"><a href="/liaoyia/categories/"><div class="headline">分类</div><div class="length-num">6</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/liaoyio" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="/liaoyia/2417276459" target="_blank" title="QQ"><i class="fas fa-qq"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/liaoyia/2020/11/12/hello-world/" title="Hello World"><img src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/liaoyia/img/404.jpg'" alt="Hello World"/></a><div class="content"><a class="title" href="/liaoyia/2020/11/12/hello-world/" title="Hello World">Hello World</a><time datetime="2020-11-12T05:23:35.000Z" title="发表于 2020-11-12 13:23:35">2020-11-12</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/liaoyia/2020/06/26/MySQL%E5%9F%BA%E7%A1%80/" title="Mysql回顾"><img src="https://cdn.jsdelivr.net/gh/liaoyio/imgHosting/img-lymysql.jpg" onerror="this.onerror=null;this.src='/liaoyia/img/404.jpg'" alt="Mysql回顾"/></a><div class="content"><a class="title" href="/liaoyia/2020/06/26/MySQL%E5%9F%BA%E7%A1%80/" title="Mysql回顾">Mysql回顾</a><time datetime="2020-06-26T12:34:53.000Z" title="发表于 2020-06-26 20:34:53">2020-06-26</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/liaoyia/2020/06/22/css%E5%B1%82%E5%8F%A0%E6%A0%B7%E5%BC%8F%E8%A1%A8/" title="Css层叠样式表期末复习"><img src="https://cdn.jsdelivr.net/gh/liaoyio/imgHosting/img-lyHTML.png" onerror="this.onerror=null;this.src='/liaoyia/img/404.jpg'" alt="Css层叠样式表期末复习"/></a><div class="content"><a class="title" href="/liaoyia/2020/06/22/css%E5%B1%82%E5%8F%A0%E6%A0%B7%E5%BC%8F%E8%A1%A8/" title="Css层叠样式表期末复习">Css层叠样式表期末复习</a><time datetime="2020-06-22T11:08:56.000Z" title="发表于 2020-06-22 19:08:56">2020-06-22</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/liaoyia/2020/04/29/MySQL%E8%A1%A8%E6%9F%A5%E8%AF%A2%E5%AE%9E%E8%AE%AD%E7%AC%94%E8%AE%B0/" title="MySQL表查询实训"><img src="https://cdn.jsdelivr.net/gh/liaoyio/imgHosting/img-lymonvpng.png" onerror="this.onerror=null;this.src='/liaoyia/img/404.jpg'" alt="MySQL表查询实训"/></a><div class="content"><a class="title" href="/liaoyia/2020/04/29/MySQL%E8%A1%A8%E6%9F%A5%E8%AF%A2%E5%AE%9E%E8%AE%AD%E7%AC%94%E8%AE%B0/" title="MySQL表查询实训">MySQL表查询实训</a><time datetime="2020-04-29T08:21:56.000Z" title="发表于 2020-04-29 16:21:56">2020-04-29</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/liaoyia/2020/04/09/MySQL%E6%95%B0%E6%8D%AE%E6%9B%B4%E6%96%B0/" title="MySQL数据更新和单表查询"><img src="https://cdn.jsdelivr.net/gh/liaoyio/imgHosting/img-lysee.png" onerror="this.onerror=null;this.src='/liaoyia/img/404.jpg'" alt="MySQL数据更新和单表查询"/></a><div class="content"><a class="title" href="/liaoyia/2020/04/09/MySQL%E6%95%B0%E6%8D%AE%E6%9B%B4%E6%96%B0/" title="MySQL数据更新和单表查询">MySQL数据更新和单表查询</a><time datetime="2020-04-09T08:08:56.000Z" title="发表于 2020-04-09 16:08:56">2020-04-09</time></div></div></div></div><div class="card-widget" id="card-newest-comments"><div class="item-headline"><i class="fas fa-bolt"></i><span>最新评论</span></div><div class="aside-list"><span>正在加载中...</span></div></div><div class="card-widget card-categories"><div class="item-headline">
            <i class="fas fa-folder-open"></i>
            <span>分类</span>
            
            </div>
            <ul class="card-category-list" id="aside-cat-list">
            <li class="card-category-list-item "><a class="card-category-list-link" href="/liaoyia/categories/Git/"><span class="card-category-list-name">Git</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/liaoyia/categories/Linux/"><span class="card-category-list-name">Linux</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/liaoyia/categories/hexo-blog/"><span class="card-category-list-name">hexo-blog</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/liaoyia/categories/linux/"><span class="card-category-list-name">linux</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/liaoyia/categories/%E6%96%87%E5%AD%97%E5%8F%99%E8%BF%B0%E4%BD%93/"><span class="card-category-list-name">文字叙述体</span><span class="card-category-list-count">2</span></a><ul class="card-category-list child"><li class="card-category-list-item "><a class="card-category-list-link" href="/liaoyia/categories/%E6%96%87%E5%AD%97%E5%8F%99%E8%BF%B0%E4%BD%93/%E7%94%9F%E8%80%8C%E4%B8%BA%E4%BA%BA-%E6%8A%B1%E6%AD%89/"><span class="card-category-list-name">生而为人 抱歉</span><span class="card-category-list-count">1</span></a></li></ul></li>
            </ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/liaoyia/tags/My-blog/" style="font-size: 1.23em; color: rgb(182, 196, 42)">My blog</a><a href="/liaoyia/tags/Git/" style="font-size: 1.1em; color: rgb(194, 181, 104)">Git</a><a href="/liaoyia/tags/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/" style="font-size: 1.5em; color: rgb(105, 135, 166)">学习笔记</a><a href="/liaoyia/tags/%E8%8F%9C%E9%B8%9F%E5%85%A5%E9%97%A8/" style="font-size: 1.5em; color: rgb(59, 162, 68)">菜鸟入门</a><a href="/liaoyia/tags/%E5%85%B3%E4%BA%8E%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/" style="font-size: 1.1em; color: rgb(38, 34, 178)">关于博客搭建</a><a href="/liaoyia/tags/Linux/" style="font-size: 1.37em; color: rgb(94, 94, 108)">Linux</a><a href="/liaoyia/tags/Markdown/" style="font-size: 1.1em; color: rgb(53, 119, 76)">Markdown</a><a href="/liaoyia/tags/MySQL/" style="font-size: 1.37em; color: rgb(119, 99, 105)">MySQL</a><a href="/liaoyia/tags/HTML-CSS/" style="font-size: 1.23em; color: rgb(25, 2, 155)">HTML+CSS</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/liaoyia/archives/2020/11/"><span class="card-archive-list-date">十一月 2020</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/liaoyia/archives/2020/06/"><span class="card-archive-list-date">六月 2020</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/liaoyia/archives/2020/04/"><span class="card-archive-list-date">四月 2020</span><span class="card-archive-list-count">4</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/liaoyia/archives/2020/03/"><span class="card-archive-list-date">三月 2020</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/liaoyia/archives/2019/12/"><span class="card-archive-list-date">十二月 2019</span><span class="card-archive-list-count">3</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/liaoyia/archives/2019/11/"><span class="card-archive-list-date">十一月 2019</span><span class="card-archive-list-count">4</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/liaoyia/archives/2018/11/"><span class="card-archive-list-date">十一月 2018</span><span class="card-archive-list-count">1</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">16</div></div><div class="webinfo-item"><div class="item-name">本站总字数 :</div><div class="item-count">29.1k</div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2021-03-21T06:57:01.973Z"></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('https://cdn.jsdelivr.net/gh/liaoyio/imgHosting/aaaaaaaa.png')"><div id="footer-wrap"><div class="copyright">&copy;2018 - 2021 <i style="color:#FF6A6A" class="fa fa-heartbeat"></i> John Doe</div><div class="footer_custom_text">Hi, welcome to my <a target="_blank" rel="noopener" href="https://liaoyi.xyz/">blog</a>!</div></div><div class="container" id="jsi-flying-fish-container"></div><script src="js/fish.js"></script><style>@media only screen and (max-width: 767px){
#sidebar_search_box input[type=text]{width:calc(100% - 24px)}
}</style></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div></div><hr/><div id="local-search-results"></div><span class="search-close-button"><i class="fas fa-times"></i></span></div><div id="search-mask"></div></div><div><script src="/liaoyia/js/utils.js"></script><script src="/liaoyia/js/main.js"></script><script src="/liaoyia/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script>function panguFn () {
  if (typeof pangu === 'object') pangu.autoSpacingPage()
  else {
    getScript('https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js')
      .then(() => {
        pangu.autoSpacingPage()
      })
  }
}

function panguInit () {
  if (false){
    GLOBAL_CONFIG_SITE.isPost && panguFn()
  } else {
    panguFn()
  }
}

document.addEventListener('DOMContentLoaded', panguInit)</script><script src="/liaoyia/js/search/local-search.js"></script><div class="js-pjax"><script>function subtitleType () {
  if (true) { 
    var typed = new Typed("#subtitle", {
      strings: "有很多的向往&#44;只能先装作不喜欢,When you want to give up &#44 think about why you started".split(","),
      startDelay: 300,
      typeSpeed: 150,
      loop: true,
      backSpeed: 50
    })
  } else {
    document.getElementById("subtitle").innerHTML = '有很多的向往&#44;只能先装作不喜欢'
  }
}

if (true) {
  if (typeof Typed === 'function') {
    subtitleType()
  } else {
    getScript('https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js').then(subtitleType)
  }
} else {
  subtitleType()
}</script></div><script src="https://cdn.jsdelivr.net/gh/sviptzk/HexoStaticFile@latest/Hexo/js/mouse_snow.min.js"></script><script src="js/jquery.min.js"></script><script src="/js/fish.js"></script><div class="aplayer no -destroy" data-id="000PeZCQ1i4XVs" data-server="tencent" data-type="artist" data-fixed="true" data-mini=" true" data-listFolded="false" data-order="random" data-preload="none" data-autoplay="true" muted></div><script src="/js/fishes.js"></script><script id="click-heart" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-heart.min.js" async="async" mobile="true"></script><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script><script src="https://cdn.jsdelivr.net/gh/metowolf/MetingJS@1.2/dist/Meting.min.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>